package com.example.project.api.service;

import com.example.project.api.model.TbUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.project.api.mapper.TbUserMapper;

/**
 * @author: Jerry.Zhang
 * @date: 2022/9/22 14:23
 */
@Service
public class TbUserService extends ServiceImpl<TbUserMapper, TbUser> {

    @Autowired
    private TbUserMapper tbUserMapper;

    /**
     * 根据ip获取用户
     *
     * @param ip
     * @return
     */
    public TbUser getUserByIp(String ip) {
        return tbUserMapper.getUserByIp(ip);
    }

}
